package com.lingyun.mqttserver.controller;

import com.lingyun.mqttserver.service.ManageDataService;
import com.lingyun.mqttserver.vo.BindDeviceDTO;
import com.lingyun.mqttserver.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("screen")
public class ScreenMappingController {

    @Autowired
    private ManageDataService manageDataService;

    @GetMapping("getNormalScreens")
    private Result getNormalScreens(){
        return manageDataService.getNormalScreens();
    }

    @GetMapping("boundDevices")
    private Result boundDevices(@RequestParam Integer screenId){
        return manageDataService.boundDevices(screenId);
    }

    @PostMapping("bindDevice")
    private Result bindDevice(@RequestBody BindDeviceDTO deviceDTO){
        return manageDataService.bindDevice(deviceDTO);
    }

}
